﻿
using StarForce;
using UnityEngine.UI;

namespace ETHotfix
{
    class HallUI : HotfixUGuiForm
    {
        public const string PrefabName = "HallUI";
        public override void OnInit(StarForce.HotfixUGuiForm uiFormLogic, object userdata)
        {
            base.OnInit(uiFormLogic, userdata);
            Log.Info("HallUI OnInit");
            uiFormLogic.variables.Get<Button>("goButton").onClick.AddListener(async () =>
            {
                await GFGame.UI.OpenUIFormAsync(GameUI.PrefabName.GetUIPath(), "Low",  true);
            });
            uiFormLogic.variables.Get<Button>("backButton").onClick.AddListener( () =>
            {
                uiFormLogic.Close();
            });
        }

        public override void OnOpen(object userdata)
        {
            base.OnOpen(userdata);
            Log.Info("HallUI OnOpen");
        }

        public override void OnClose(object userdata)
        {
            base.OnClose(userdata);
            Log.Info("HallUI OnClose");
        }

        public override void OnPause()
        {
            base.OnPause();
            Log.Info("HallUI OnPause");
        }

        public override void OnResume(object userdata)
        {
            base.OnResume(userdata);
            Log.Info("HallUI OnResume");
        }

        public override void OnCover(object userdata)
        {
            base.OnCover(userdata);
            Log.Info("HallUI OnCover");
        }

        public override void OnReveal()
        {
            base.OnReveal();
            Log.Info("HallUI OnReveal");
        }

        public override void OnRefocus(object userData)
        {
            base.OnRefocus(userData);
            Log.Info("HallUI OnRefocus");
        }

        public override void OnDepthChanged(int uiGroupDepth, int depthInUIGroup)
        {
            base.OnDepthChanged(uiGroupDepth, depthInUIGroup);
            Log.Info("HallUI OnDepthChanged");
        }
    }
}
